String.prototype['format'] = function () {
    const e = arguments;
    return !!this && this.replace(/\{(\d+)\}/g, function (t, r) {
      return e[r] ? e[r] : t;
    });
  };

/* Generated from Java with JSweet 3.0.0 - http://www.jsweet.org */
var com;
(function (com) {
    var cfks;
    (function (cfks) {
        var lanscript;
        (function (lanscript) {
            var LanScriptCompiler = /** @class */ (function () {
                function LanScriptCompiler() {
                }
                LanScriptCompiler.importList_$LI$ = function () { if (LanScriptCompiler.importList == null) {
                    LanScriptCompiler.importList = ([]);
                } return LanScriptCompiler.importList; };
                LanScriptCompiler.parseLanScript = function (code) {
                    var regex = "//\\*(?:(?!\\*/).|[\\r\\n])*?\\*/|[ \\t]*//.*";
                    var lines = code.replace(new RegExp(regex, 'g'), "").split("\n");
                    var ast = ([]);
                    for (var index21037 = 0; index21037 < lines.length; index21037++) {
                        var line = lines[index21037];
                        {
                            line = line.trim();
                            if ( /* isEmpty */(line.length === 0)) {
                                continue;
                            }
                            var pattern = java.util.regex.Pattern.compile("\\)[ \\t]*::$");
                            if (!(function (str, searchString) { var pos = str.length - searchString.length; var lastIndex = str.indexOf(searchString, pos); return lastIndex !== -1 && lastIndex === pos; })(line, ";") && !pattern.matcher(line).find() && !(function (str, searchString) { var pos = str.length - searchString.length; var lastIndex = str.indexOf(searchString, pos); return lastIndex !== -1 && lastIndex === pos; })(line, "::")) {
                                throw Object.defineProperty(new Error(line + "\n" + LanScriptCompiler.fastSpace(line.length + 1) + " ^ \ufffd\ufffd\ufffd\ufffd\ufffd\ufffd\";\""), '__classes', { configurable: true, value: ['java.lang.Throwable', 'java.lang.Object', 'java.lang.RuntimeException', 'java.lang.Exception'] });
                            }
                            if (LanScriptCompiler.inFun && !(line === ("::"))) {
                                var lastItem = ast[ /* size */ast.length - 1];
                                var statement = line.substring(0, line.length - 2).split("\\(");
                                if (statement.length > 0 && !(statement[0].length === 0)) {
                                    if (lastItem != null && lastItem instanceof com.cfks.lanscript.LanScriptCompiler.Variable) {
                                        /* add */ (lastItem.body.push(LanScriptCompiler.callFunAST(statement[0], statement[1])) > 0);
                                    }
                                    else if (lastItem != null && lastItem instanceof com.cfks.lanscript.LanScriptCompiler.Function) {
                                        /* add */ (lastItem.body.push(LanScriptCompiler.callFunAST(statement[0], statement[1])) > 0);
                                    }
                                }
                            }
                            if ( /* startsWith */(function (str, searchString, position) {
                                if (position === void 0) { position = 0; }
                                return str.substr(position, searchString.length) === searchString;
                            })(line, "public") && !(function (str, searchString, position) {
                                if (position === void 0) { position = 0; }
                                return str.substr(position, searchString.length) === searchString;
                            })(line, "public fun")) {
                                var parts = line.substring(0, line.length - 1).split(" ");
                                var name_1 = parts[1];
                                var type = parts[3];
                                var value = parts.length > 5 ? parts[5] : LanScriptCompiler.getValDefValue(type);
                                /* add */ (ast.push(new LanScriptCompiler.Variable(name_1, type, value)) > 0);
                            }
                            else if ( /* startsWith */(function (str, searchString, position) {
                                if (position === void 0) { position = 0; }
                                return str.substr(position, searchString.length) === searchString;
                            })(line, "public fun")) {
                                LanScriptCompiler.inFun = true;
                                var parts = line.split(" ");
                                var name_2 = parts[3].substring(0, parts[3].length - 1).split("\\(")[0];
                                var params = parts[3].substring(0, parts[3].length - 2).split("\\(")[1];
                                params = /* replaceAll */ params.substring(0, params.length - 1).replace(new RegExp(" ", 'g'), "");
                                params = /* isEmpty */ (params.length === 0) ? "void" : params;
                                var returnType = parts[2];
                                var body = ([]);
                                /* add */ (ast.push(new LanScriptCompiler.Function(name_2, body, returnType, params)) > 0);
                            }
                            else if (line === ("::")) {
                                LanScriptCompiler.inFun = false;
                            }
                            else if ( /* startsWith */(function (str, searchString, position) {
                                if (position === void 0) { position = 0; }
                                return str.substr(position, searchString.length) === searchString;
                            })(line, "use")) {
                                var parts = line.substring(0, line.length - 1).split(" ");
                                /* add */ (LanScriptCompiler.importList_$LI$().push(parts[1]) > 0);
                            }
                            else if ( /* contains */(line.indexOf("(") != -1) && /* contains */ (line.indexOf(");") != -1) && !LanScriptCompiler.inFun) {
                                var statement = line.substring(0, line.length - 1).split("\\(");
                                if (statement.length > 0 && !(statement[0].length === 0)) {
                                    /* add */ (ast.push(LanScriptCompiler.callFunAST2(statement[0], statement[1].substring(0, statement[1].length - 1))) > 0);
                                }
                            }
                        }
                    }
                    return ast;
                };
                LanScriptCompiler.callFunAST = function (name, params) {
                    var importPack = "";
                    for (var index21038 = 0; index21038 < LanScriptCompiler.importList_$LI$().length; index21038++) {
                        var importName = LanScriptCompiler.importList_$LI$()[index21038];
                        {
                            if (importName.split("\\.")[importName.split("\\.").length - 1] === (name.split("\\.")[0])) {
                                importPack = importName;
                                break;
                            }
                        }
                    }
                    return new LanScriptCompiler.FunctionCall(!( /* replaceAll */importPack.replace(new RegExp("\\.", 'g'), "/").length === 0) ? /* replaceAll */ importPack.replace(new RegExp("\\.", 'g'), "/") + "/" + /* replaceAll */ /* replaceAll */ name.replace(new RegExp(importPack.split("\\.")[importPack.split("\\.").length - 1] + "\\.", 'g'), "").replace(new RegExp("\\.", 'g'), "/") : /* replaceAll */ name.replace(new RegExp("\\.", 'g'), "/"), /* isEmpty */ ( /* replaceAll */ /* replaceAll */params.replace(new RegExp(" ", 'g'), "").replace(new RegExp(",", 'g'), " ").length === 0) ? "void" : /* replaceAll */ /* replaceAll */ params.replace(new RegExp(" ", 'g'), "").replace(new RegExp(",", 'g'), " "));
                };
                LanScriptCompiler.callFunAST2 = function (name, params) {
                    var importPack = "";
                    for (var index21039 = 0; index21039 < LanScriptCompiler.importList_$LI$().length; index21039++) {
                        var importName = LanScriptCompiler.importList_$LI$()[index21039];
                        {
                            if (importName.split("\\.")[importName.split("\\.").length - 1] === (name.split("\\.")[0])) {
                                importPack = importName;
                                break;
                            }
                        }
                    }
                    return new LanScriptCompiler.FunctionCall(!( /* replaceAll */importPack.replace(new RegExp("\\.", 'g'), "/").length === 0) ? /* replaceAll */ importPack.replace(new RegExp("\\.", 'g'), "/") + "/" + /* replaceAll */ /* replaceAll */ name.replace(new RegExp(importPack.split("\\.")[importPack.split("\\.").length - 1] + "\\.", 'g'), "").replace(new RegExp("\\.", 'g'), "/") : /* replaceAll */ name.replace(new RegExp("\\.", 'g'), "/"), /* isEmpty */ ( /* replaceAll */ /* replaceAll */params.replace(new RegExp(" ", 'g'), "").replace(new RegExp(",", 'g'), " ").length === 0) ? "" : /* replaceAll */ /* replaceAll */ params.replace(new RegExp(" ", 'g'), "").replace(new RegExp(",", 'g'), " "));
                };
                LanScriptCompiler.generateLSC = function (ast) {
                    var lsoCode = { str: "", toString: function () { return this.str; } };
                    var _loop_1 = function (index21040) {
                        var item = ast[index21040];
                        {
                            if (item != null && item instanceof com.cfks.lanscript.LanScriptCompiler.Variable) {
                                var variable_1 = item;
                                /* append */ (function (sb) { sb.str += "\n"; return sb; })(/* append */ (function (sb) { sb.str += variable_1.value; return sb; })(/* append */ (function (sb) { sb.str += " "; return sb; })(/* append */ (function (sb) { sb.str += variable_1.dataType; return sb; })(/* append */ (function (sb) { sb.str += " "; return sb; })(/* append */ (function (sb) { sb.str += variable_1.name; return sb; })(/* append */ (function (sb) { sb.str += "public val "; return sb; })(lsoCode)))))));
                            }
                            else if (item != null && item instanceof com.cfks.lanscript.LanScriptCompiler.Function) {
                                var __function_1 = item;
                                /* append */ (function (sb) { sb.str += " funstart\n"; return sb; })(/* append */ (function (sb) { sb.str += __function_1.params; return sb; })(/* append */ (function (sb) { sb.str += " "; return sb; })(/* append */ (function (sb) { sb.str += __function_1.name; return sb; })(/* append */ (function (sb) { sb.str += " "; return sb; })(/* append */ (function (sb) { sb.str += __function_1.returnType; return sb; })(/* append */ (function (sb) { sb.str += "public fun "; return sb; })(lsoCode)))))));
                                var _loop_2 = function (index21041) {
                                    var statement = __function_1.body[index21041];
                                    {
                                        var call_1 = statement;
                                        /* append */ (function (sb) { sb.str += "\n"; return sb; })(/* append */ (function (sb) { sb.str += call_1.params === ("void") ? "void" : "val:" + call_1.params; return sb; })(/* append */ (function (sb) { sb.str += " "; return sb; })(/* append */ (function (sb) { sb.str += call_1.name; return sb; })(/* append */ (function (sb) { sb.str += "F"; return sb; })(lsoCode)))));
                                    }
                                };
                                for (var index21041 = 0; index21041 < __function_1.body.length; index21041++) {
                                    _loop_2(index21041);
                                }
                                /* append */ (function (sb) { sb.str += "funend\n"; return sb; })(lsoCode);
                            }
                            else if (item != null && item instanceof com.cfks.lanscript.LanScriptCompiler.FunctionCall) {
                                var call_2 = item;
                                var path_1 = call_2.name;
                                if (!(path_1.indexOf("/") != -1)) {
                                    path_1 = "this/" + path_1;
                                }
                                /* append */ (function (sb) { sb.str += "\n"; return sb; })(/* append */ (function (sb) { sb.str += (call_2.params.length === 0) ? "" : "val:" + call_2.params; return sb; })(/* append */ (function (sb) { sb.str += " "; return sb; })(/* append */ (function (sb) { sb.str += path_1; return sb; })(/* append */ (function (sb) { sb.str += "F"; return sb; })(lsoCode)))));
                            }
                        }
                    };
                    for (var index21040 = 0; index21040 < ast.length; index21040++) {
                        _loop_1(index21040);
                    }
                    return /* toString */ lsoCode.str;
                };
                LanScriptCompiler.getValDefValue = function (type) {
                    switch ((type)) {
                        case "String":
                            return "\"\"";
                        case "Number":
                            return "0";
                        default:
                            return "null";
                    }
                };
                LanScriptCompiler.fastSpace = function (num) {
                    var result = "";
                    for (var i = 0; i < num; i++) {
                        {
                            result += " ";
                        }
                        ;
                    }
                    return result;
                };
                LanScriptCompiler.compile = function (code) {
                    /* clear */ (LanScriptCompiler.importList_$LI$().length = 0);
                    var ast = LanScriptCompiler.parseLanScript(code);
                    return LanScriptCompiler.generateLSC(ast);
                };
                LanScriptCompiler.inFun = false;
                return LanScriptCompiler;
            }());
            lanscript.LanScriptCompiler = LanScriptCompiler;
            LanScriptCompiler["__class"] = "com.cfks.lanscript.LanScriptCompiler";
            (function (LanScriptCompiler) {
                var Variable = /** @class */ (function () {
                    function Variable(name, dataType, value) {
                        if (this.name === undefined) {
                            this.name = null;
                        }
                        if (this.dataType === undefined) {
                            this.dataType = null;
                        }
                        if (this.value === undefined) {
                            this.value = null;
                        }
                        this.body = ([]);
                        this.name = name;
                        this.dataType = dataType;
                        this.value = value;
                    }
                    return Variable;
                }());
                LanScriptCompiler.Variable = Variable;
                Variable["__class"] = "com.cfks.lanscript.LanScriptCompiler.Variable";
                var Function = /** @class */ (function () {
                    function Function(name, body, returnType, params) {
                        if (this.name === undefined) {
                            this.name = null;
                        }
                        if (this.body === undefined) {
                            this.body = null;
                        }
                        if (this.returnType === undefined) {
                            this.returnType = null;
                        }
                        if (this.params === undefined) {
                            this.params = null;
                        }
                        this.name = name;
                        this.body = body;
                        this.returnType = returnType;
                        this.params = params;
                    }
                    return Function;
                }());
                LanScriptCompiler.Function = Function;
                Function["__class"] = "com.cfks.lanscript.LanScriptCompiler.Function";
                var FunctionCall = /** @class */ (function () {
                    function FunctionCall(name, params) {
                        if (this.name === undefined) {
                            this.name = null;
                        }
                        if (this.params === undefined) {
                            this.params = null;
                        }
                        this.name = name;
                        this.params = params;
                    }
                    return FunctionCall;
                }());
                LanScriptCompiler.FunctionCall = FunctionCall;
                FunctionCall["__class"] = "com.cfks.lanscript.LanScriptCompiler.FunctionCall";
            })(LanScriptCompiler = lanscript.LanScriptCompiler || (lanscript.LanScriptCompiler = {}));
        })(lanscript = cfks.lanscript || (cfks.lanscript = {}));
    })(cfks = com.cfks || (com.cfks = {}));
})(com || (com = {}));


/* Generated from Java with JSweet 3.0.0 - http://www.jsweet.org */
var com;
(function (com) {
    var cfks;
    (function (cfks) {
        var lanscript;
        (function (lanscript) {
            var LanScriptRunner = /** @class */ (function () {
                function LanScriptRunner() {
                }
                LanScriptRunner.valList_$LI$ = function () { if (LanScriptRunner.valList == null) {
                    LanScriptRunner.valList = ([]);
                } return LanScriptRunner.valList; };
                LanScriptRunner.funList_$LI$ = function () { if (LanScriptRunner.funList == null) {
                    LanScriptRunner.funList = ([]);
                } return LanScriptRunner.funList; };
                LanScriptRunner.fromThisVal_$LI$ = function () { if (LanScriptRunner.fromThisVal == null) {
                    LanScriptRunner.fromThisVal = ([]);
                } return LanScriptRunner.fromThisVal; };
                LanScriptRunner.run = function (str) {
                    var str1 = str.split("\n");
                    var params = ([]);
                    var calls = ([]);
                    for (var i = 0; i < str1.length; i++) {
                        {
                            var code = str1[i].trim();
                            if ( /* startsWith */(function (str, searchString, position) {
                                if (position === void 0) { position = 0; }
                                return str.substr(position, searchString.length) === searchString;
                            })(code, "public val")) {
                                var code1 = code.split(" ");
                                /* add */ (LanScriptRunner.valList_$LI$().push(new LanScriptRunner.Val(code1[2], code1[3], code1[4])) > 0);
                            }
                            else if ( /* startsWith */(function (str, searchString, position) {
                                if (position === void 0) { position = 0; }
                                return str.substr(position, searchString.length) === searchString;
                            })(code, "public fun")) {
                                LanScriptRunner.inFunction = true;
                                /* clear */ (params.length = 0);
                                /* clear */ (calls.length = 0);
                                var code1 = code.split(" ");
                                LanScriptRunner.functionType = new LanScriptRunner.LClass(/* replace */ code1[2].split("F").join(""));
                                LanScriptRunner.functionName = code1[3];
                                for (var k = 4; k < code1.length - 1; k++) {
                                    {
                                        if (!(code1[k] === ("void"))) {
                                            /* add */ (params.push(new LanScriptRunner.Param(new LanScriptRunner.LClass(code1[k].split(":")[1]), code1[k].split(":")[0])) > 0);
                                        }
                                    }
                                    ;
                                }
                                LanScriptRunner.functionParams = /* toArray */ params.slice(0);
                            }
                            else if (code === ("funend")) {
                                LanScriptRunner.inFunction = false;
                                var code1 = code.split(" ");
                                LanScriptRunner.functionCalls = /* toArray */ calls.slice(0);
                                /* add */ (LanScriptRunner.funList_$LI$().push(new LanScriptRunner.Function(LanScriptRunner.functionType, LanScriptRunner.functionName, LanScriptRunner.functionParams, LanScriptRunner.functionCalls)) > 0);
                            }
                            else if ( /* startsWith */(function (str, searchString, position) {
                                if (position === void 0) { position = 0; }
                                return str.substr(position, searchString.length) === searchString;
                            })(code, "F")) {
                                var code1 = code.split(" ");
                                var params1 = ([]);
                                for (var k = 1; k < code1.length; k++) {
                                    {
                                        if ( /* startsWith */(function (str, searchString, position) {
                                            if (position === void 0) { position = 0; }
                                            return str.substr(position, searchString.length) === searchString;
                                        })(code1[k], "val:")) {
                                            for (var j = 0; j < /* size */ LanScriptRunner.valList_$LI$().length; j++) {
                                                {
                                                    if ( /* get */LanScriptRunner.valList_$LI$()[j].name === /* replace */ code1[k].split("val:").join("")) {
                                                        /* add */ (params1.push(new LanScriptRunner.ParamValue(LanScriptRunner.ParamValue.from_val, /* get */ LanScriptRunner.valList_$LI$()[j].value)) > 0);
                                                        /* add */ (LanScriptRunner.fromThisVal_$LI$().push(new LanScriptRunner.FromThisVal("Occupied")) > 0);
                                                    }
                                                }
                                                ;
                                            }
                                        }
                                        else if ( /* startsWith */(function (str, searchString, position) {
                                            if (position === void 0) { position = 0; }
                                            return str.substr(position, searchString.length) === searchString;
                                        })(code1[k], "this:") && LanScriptRunner.inFunction === true) {
                                            /* add */ (params1.push(new LanScriptRunner.ParamValue(LanScriptRunner.ParamValue.from_this_val, "")) > 0);
                                            /* add */ (LanScriptRunner.fromThisVal_$LI$().push(new LanScriptRunner.FromThisVal(/* replace */ code1[k].split("this:").join(""))) > 0);
                                        }
                                        else {
                                            /* add */ (params1.push(new LanScriptRunner.ParamValue(LanScriptRunner.ParamValue.from_value, code1[k])) > 0);
                                            /* add */ (LanScriptRunner.fromThisVal_$LI$().push(new LanScriptRunner.FromThisVal("Occupied")) > 0);
                                        }
                                    }
                                    ;
                                }
                                var call = new LanScriptRunner.Call(new LanScriptRunner.LFunction(/* replace */ code1[0].split("F").join("")), /* toArray */ params1.slice(0));
                                if (LanScriptRunner.inFunction === true) {
                                    /* add */ (calls.push(call) > 0);
                                }
                                else {
                                    call.call();
                                }
                            }
                        }
                        ;
                    }
                };
                LanScriptRunner.isNumeric = function (cs) {
                    if (cs == null) {
                        return false;
                    }
                    var sz = cs.length;
                    for (var i = 0; i < sz; i++) {
                        {
                            if (!/\d/.test(cs.charAt(i)[0])) {
                                return false;
                            }
                        }
                        ;
                    }
                    return true;
                };
                LanScriptRunner.log = function (message) {
                const y = 'yyyy';
    const M = 'MM';
    const d = 'dd';
    const H = 'HH';
    const m = 'mm';
    const s = 'ss';
    const time = new Date();
    let str = "yyyy-MM-dd HH:mm:ss".replace(y, time.getFullYear());
    str = str.replace(M, ('0' + (time.getMonth() + 1)).slice(-2));
    str = str.replace(d, ('0' + time.getDate()).slice(-2));
    str = str.replace(H, ('0' + time.getHours()).slice(-2));
    str = str.replace(m, ('0' + time.getMinutes()).slice(-2));
    str = str.replace(s, ('0' + time.getSeconds()).slice(-2));
    console.log("LanScriptLog " + str + "输出: " + message);
                };
                LanScriptRunner.inFunction = false;
                LanScriptRunner.functionType = null;
                LanScriptRunner.functionName = "";
                LanScriptRunner.functionParams = null;
                LanScriptRunner.functionCalls = null;
                LanScriptRunner.runContext = "android";
                return LanScriptRunner;
            }());
            lanscript.LanScriptRunner = LanScriptRunner;
            LanScriptRunner["__class"] = "com.cfks.lanscript.LanScriptRunner";
            (function (LanScriptRunner) {
                var Val = /** @class */ (function () {
                    function Val(name, type, value) {
                        this.name = "";
                        this.type = "";
                        this.value = "";
                        this.name = name;
                        this.type = type;
                        this.value = value;
                    }
                    return Val;
                }());
                LanScriptRunner.Val = Val;
                Val["__class"] = "com.cfks.lanscript.LanScriptRunner.Val";
                var Call = /** @class */ (function () {
                    function Call(path, params) {
                        this.path = null;
                        this.params = null;
                        this.path = path;
                        this.params = params;
                    }
                    Call.prototype.call = function () {
                        return this.path.call(this.params);
                    };
                    return Call;
                }());
                LanScriptRunner.Call = Call;
                Call["__class"] = "com.cfks.lanscript.LanScriptRunner.Call";
                var Param = /** @class */ (function () {
                    function Param(type, name) {
                        this.type = null;
                        this.name = "";
                        this.name = name;
                        this.type = type;
                    }
                    return Param;
                }());
                LanScriptRunner.Param = Param;
                Param["__class"] = "com.cfks.lanscript.LanScriptRunner.Param";
                var ParamValue = /** @class */ (function () {
                    function ParamValue(from, value) {
                        this.from = LanScriptRunner.ParamValue.from_val;
                        this.value = "";
                        this.value = value;
                        this.from = from;
                    }
                    ParamValue.from_val = 0;
                    ParamValue.from_value = 1;
                    ParamValue.from_this_val = 2;
                    return ParamValue;
                }());
                LanScriptRunner.ParamValue = ParamValue;
                ParamValue["__class"] = "com.cfks.lanscript.LanScriptRunner.ParamValue";
                var FromThisVal = /** @class */ (function () {
                    function FromThisVal(paramName) {
                        this.paramName = "";
                        this.paramName = paramName;
                    }
                    return FromThisVal;
                }());
                LanScriptRunner.FromThisVal = FromThisVal;
                FromThisVal["__class"] = "com.cfks.lanscript.LanScriptRunner.FromThisVal";
                var Function = /** @class */ (function () {
                    function Function(type, name, params, code) {
                        this.name = "";
                        this.type = null;
                        this.params = null;
                        this.code = null;
                        this.name = name;
                        this.type = type;
                        this.params = params;
                        this.code = code;
                    }
                    Function.prototype.call$ = function () {
                        for (var i = 0; i < this.code.length; i++) {
                            {
                                return this.code[i].call();
                            }
                            ;
                        }
                        return null;
                    };
                    Function.prototype.call$com_cfks_lanscript_LanScriptRunner_ParamValue_A = function (params) {
                        for (var i = 0; i < this.code.length; i++) {
                            {
                                return this.code[i].call();
                            }
                            ;
                        }
                        return null;
                    };
                    Function.prototype.call = function (params) {
                        if (((params != null && params instanceof Array && (params.length == 0 || params[0] == null || (params[0] != null && params[0] instanceof com.cfks.lanscript.LanScriptRunner.ParamValue))) || params === null)) {
                            return this.call$com_cfks_lanscript_LanScriptRunner_ParamValue_A(params);
                        }
                        else if (params === undefined) {
                            return this.call$();
                        }
                        else
                            throw new Error('invalid overload');
                    };
                    return Function;
                }());
                LanScriptRunner.Function = Function;
                Function["__class"] = "com.cfks.lanscript.LanScriptRunner.Function";
                var LClass = /** @class */ (function () {
                    function LClass(path) {
                        this.path = "";
                        this.path = path;
                    }
                    LClass.prototype.getFunction = function (name) {
                        return null;
                    };
                    LClass.getLClass = function (value) {
                        if ( /* startsWith */(function (str, searchString, position) {
                            if (position === void 0) { position = 0; }
                            return str.substr(position, searchString.length) === searchString;
                        })(value, "\"") && /* endsWith */ (function (str, searchString) { var pos = str.length - searchString.length; var lastIndex = str.indexOf(searchString, pos); return lastIndex !== -1 && lastIndex === pos; })(value, "\"")) {
                            return new LanScriptRunner.LClass("lan.lang.String");
                        }
                        else if (LanScriptRunner.isNumeric(value)) {
                            return new LanScriptRunner.LClass("lan.lang.Number");
                        }
                        return null;
                    };
                    return LClass;
                }());
                LanScriptRunner.LClass = LClass;
                LClass["__class"] = "com.cfks.lanscript.LanScriptRunner.LClass";
                var LFunction = /** @class */ (function () {
                    function LFunction(path) {
                        this.path = "";
                        this.path = path;
                    }
                    LFunction.prototype.call = function (params) {
                        if ( /* startsWith */(function (str, searchString, position) {
                            if (position === void 0) { position = 0; }
                            return str.substr(position, searchString.length) === searchString;
                        })(this.path, "this/")) {
                            for (var j = 0; j < /* size */ com.cfks.lanscript.LanScriptRunner.funList_$LI$().length; j++) {
                                {
                                    if ( /* get */com.cfks.lanscript.LanScriptRunner.funList_$LI$()[j].name === /* replace */ this.path.split("this/").join("")) {
                                        for (var i = 0; i < /* size */ com.cfks.lanscript.LanScriptRunner.fromThisVal_$LI$().length; i++) {
                                            {
                                                if (!( /* get */com.cfks.lanscript.LanScriptRunner.fromThisVal_$LI$()[i].paramName === ("Occupied"))) {
                                                    for (var a = 0; a < /* get */ com.cfks.lanscript.LanScriptRunner.funList_$LI$()[j].code.length; a++) {
                                                        {
                                                            for (var b = 0; b < /* get */ com.cfks.lanscript.LanScriptRunner.funList_$LI$()[j].code[a].params.length; b++) {
                                                                {
                                                                    if ( /* get */com.cfks.lanscript.LanScriptRunner.funList_$LI$()[j].code[a].params[b].from === LanScriptRunner.ParamValue.from_this_val) {
                                                                        /* get */ com.cfks.lanscript.LanScriptRunner.funList_$LI$()[j].code[a].params[b].value = params[b].value;
                                                                    }
                                                                }
                                                                ;
                                                            }
                                                        }
                                                        ;
                                                    }
                                                }
                                            }
                                            ;
                                        }
                                        return /* get */ com.cfks.lanscript.LanScriptRunner.funList_$LI$()[j].call$com_cfks_lanscript_LanScriptRunner_ParamValue_A(params);
                                    }
                                }
                                ;
                            }
                        }
                        else if ( /* startsWith */(function (str, searchString, position) {
                            if (position === void 0) { position = 0; }
                            return str.substr(position, searchString.length) === searchString;
                        })(this.path, "lan/")) {
                            switch ((this.path)) {
                                case "lan/System/log":
                                    LanScriptRunner.log(params[0].value);
                                    break;
                                case "lan/System/setRunContext":
                                    com.cfks.lanscript.LanScriptRunner.runContext = params[0].value;
                                    break;
                                default:
                                    break;
                            }
                        }
                        else {
                            return null;
                        }
                        return null;
                    };
                    return LFunction;
                }());
                LanScriptRunner.LFunction = LFunction;
                LFunction["__class"] = "com.cfks.lanscript.LanScriptRunner.LFunction";
            })(LanScriptRunner = lanscript.LanScriptRunner || (lanscript.LanScriptRunner = {}));
        })(lanscript = cfks.lanscript || (cfks.lanscript = {}));
    })(cfks = com.cfks || (com.cfks = {}));
})(com || (com = {}));

/* Generated from Java with JSweet 3.0.0 - http://www.jsweet.org */
var com;
(function (com) {
    var cfks;
    (function (cfks) {
        var lanscript;
        (function (lanscript) {
            var Main = /** @class */ (function () {
                function Main() {
                }
                Main.main = function (args) {
                    try {
                        if (args[0] === ("lsc")) {
                            var startTime = Date.now();
                            let result = com.cfks.lanscript.LanScriptCompiler.compile(args[1]);
                            var endTime = Date.now();
                            console.log("Compile successfully! Takes {0} ms. Save path: {1}".format(endTime - startTime, "savePath.lsc"));
                            return result;
                        }
                        else if (args[0] === ("lsr")) {
                            var startTime = Date.now();
                            com.cfks.lanscript.LanScriptRunner.run(args[1]);
                            var endTime = Date.now();
                            console.log("Running successfully! Takes {0} ms.".format(endTime - startTime));
                            return "";
                        }
                    }
                    catch (e) {
                        com.cfks.lanscript.LanScriptRunner.log("Error: " + e.message);
                        return "";
                    }
                    return "";
                };
                return Main;
            }());
            lanscript.Main = Main;
            Main["__class"] = "com.cfks.lanscript.Main";
        })(lanscript = cfks.lanscript || (cfks.lanscript = {}));
    })(cfks = com.cfks || (com.cfks = {}));
})(com || (com = {}));